<?php
class Ofx_Plugin_Auth extends Zend_Controller_Plugin_Abstract
{
	
	public function preDispatch(Zend_Controller_Request_Abstract $request)
	{		
		//echo "<br>Auth: preDispatch";
    	$action = $request->getActionName();
    	$controller = $request->getControllerName();
    	//kiem tra da ton tai Auth?
    	$auth  = Zend_Auth::getInstance();			
		if(!$auth->hasIdentity()){
			if ($controller != 'login'){
	            $this->getResponse()->setRedirect('/user/login/');	            
	        }	
		}		
	}
}